﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
using Utility;

namespace Web.giaovien
{
    public partial class UCTinTuc : System.Web.UI.UserControl
    {
        ThongBaoControl tbCtr = new ThongBaoControl();
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                GridView1.AllowPaging = true;
                GridView1.PageSize = 5;
                LoadThongBao();
            }
        }

        private void LoadThongBao()
        {
            GridView1.DataSource = tbCtr.GetListThongBao();
            GridView1.DataBind();
        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            WebHelper.pageIndexChanging(GridView1 , e);
            LoadThongBao();
        }

    
    }
}